package com.fira.api.controller;

import com.fira.api.domain.dto.LoginDTO;
import com.fira.common.core.domain.AjaxResult;
import com.fira.edu.service.IEduStudentCourseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * 续费预警controller
 * @author tony
 * @date 2021-10-15
 */
@Api(value="续费预警信息接口",tags={"续费预警信息"})
@Controller
@RequestMapping("/api/renew")
public class RenewWarningController extends ApiController{
    @Autowired
    private IEduStudentCourseService eduStudentCourseService;

    @ApiOperation(value="查询续费预警列表",tags={"查询续费预警列表"},notes="")
    @PostMapping("/list")
    @ResponseBody
    public AjaxResult getRenewWarningList(HttpServletRequest request){
        LoginDTO loginDTO = getLogin(request);
        String tenantId = loginDTO.getCurrentTenantId();
        return AjaxResult.success("查询成功",eduStudentCourseService.selectRenewNoticeList(tenantId));
    }
}
